#!/usr/bin/env python
# -*- coding: utf-8 -*-

from sets import Set
from common import caller

def print_node():
    arr = caller.get_hot_follow()
    arr_source = Set()
    arr_target = Set()
    for row in arr:
        arr_source.add(row[0])
        arr_target.add(row[1])
        
    return ','.join(arr_source) + ', ' + ','.join(arr_target)
    '''
        {id: 437523529,  value: 40,  label: '437523529' },
        {id: 927647598,  value: 10, label: '927647598'},
        {id: 2759013270,  value: 10, label: '2759013270'},
        {id: 2654373980,  value: 10, label: '2654373980' },
        {id: 2653897764,  value: 10, label: '2653897764' },
        {id: 208361818,  value: 30, label: '208361818'},
        {id: 391362483,  value: 10,  label: '391362483'},
        {id: 31206407,  value: 10,  label: '31206407'},
        {id: 264694385,  value: 10, label: '264694385'},
        {id: 1702148870, value: 40, label: '1702148870'},
        {id: 2902062601, value: 10, label: '2902062601'},
        {id: 2902046294, value: 10, label: '2902046294'},
        {id: 2902030526, value: 10, label: '2902030526'},
        {id: 81126713, value: 10, label: '81126713'},
    '''

def print_edge():
    arr_html = []
    arr = caller.get_hot_follow()
    for row in arr:
        arr_html.append("{from:%s, to:%s, value:1, arrows: 'to', title: '%stimes'}" % (row[0], row[1], row[2]))
    return ','.join(arr_html)    
    

'''
        {from: 927647598, to: 437523529, value: 1, arrows: 'to', title: '50times'},
        {from: 2759013270, to: 437523529, value: 1, arrows: 'to', title: '50times'},
        {from: 2654373980, to: 437523529,value: 1, arrows: 'to', title: '50times'},
        {from: 2653897764, to: 437523529, value: 1, arrows: 'to', title: '50times'},
        {from: 391362483, to: 208361818, value: 1, arrows: 'to', title: '49times'},
        {from: 31206407, to: 208361818, value: 1, arrows: 'to', title: '49times'},
        {from: 264694385, to: 208361818,value: 1, arrows: 'to', title: '49times'},
        {from: 2902062601, to: 1702148870, value: 1, arrows: 'to', title: '48times'},
        {from: 2902046294, to: 1702148870, value: 1, arrows: 'to', title: '48times'},
        {from: 2902030526, to: 1702148870, value: 1, arrows: 'to', title: '48times'},
        {from: 81126713, to: 1702148870, value: 1, arrows: 'to', title: '48times'}
    '''
    